package com.kafka_test.app;

import com.alibaba.fastjson.JSONObject;
import com.kafka_test.app.service.OffsetService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.*;

@SpringBootApplication
@MapperScan("com.kafka_test.app.mapper")
public class ApiApplication {

    private static OffsetService offsetService;

    @Autowired
    public ApiApplication(OffsetService offsetService) {
        ApiApplication.offsetService = offsetService;
    }

    public static void main(String[] args) {
        SpringApplication.run(ApiApplication.class, args);

        Map<String, Object> map=new HashMap<>();
        map.put("aaa","bbb");
        map.put("ccc",11);
        JSONObject jsonObject =new JSONObject(map);
        System.out.println(String.valueOf(jsonObject));


//        JSONObject json = JSONObject.parseObject("{id_producer:20, name:ccc}");
//        Set<String> keys = json.keySet();
//        for (String key : keys) {
//            System.out.println(key);
//        }
    }
}
